{extend name="public:layout" /}

{block name="title"}
    <title>{:site('siteName')}-即时转账</title>
{/block}

{block name="css"}
    <style>
		.layui-form-label{width:60px;    padding: 9px 6px;}
		.layui-input-block{margin-left:75px;margin-right:10px;}
		.layui-form-item { margin-bottom: 9px;}
		.layui-input::-webkit-input-placeholder{ color: #999;font-size:12px;}
		.layui-input::-moz-placeholder{  color: #999;font-size:12px; }
		.layui-input:-ms-input-placeholder{color: #999;font-size:12px;}
    </style>
{/block}

{block name="content"}
    <div class="head">即时转账</div>
    <blockquote class="layui-elem-quote layui-quote-nm">转账说明：转账支出的是 {$currency.recharge} 和 {$currency.money}，可以兑换 {$currency.game} 和 {$currency.shopping}，以及转账给其他用户 {$currency.recharge} 。</blockquote>
    <form class="layui-form" action="{:url('index/user/transfer')}">
		<div class="layui-form-item margin-left-300 margin-top-25">
            <label class="layui-form-label width-small">
                转账方式
            </label>
            <div class="layui-input-block">
            	<input checked="" name="mode" title="转给自己" type="radio"  lay-filter="account" value="0">
                <input name="mode" title="转给别人" type="radio" lay-filter="account" value="1">
            </div>
        </div>
		<div class="layui-form-item" id="account">
            
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">转账类型</label>
            <div class="layui-input-block">
                <select lay-verify="required" name="type">
                    <option value="0">{$currency.recharge} 转 {$currency.recharge}</option>
                    <option value="1">{$currency.recharge} 转 {$currency.game}</option>
                    <!-- <option value="2">{$currency.recharge} 转 {$currency.shopping}</option> -->
                    <option value="3">{$currency.money} 转 {$currency.recharge}</option>
                    <option value="4">{$currency.money} 转 {$currency.game}</option>
                    <!-- <option value="5">{$currency.money} 转 {$currency.shopping}</option> -->
                </select>
            </div>
        </div>
		<div class="layui-form-item">
		    <label class="layui-form-label">转账金额</label>
		    <div class="layui-input-block">
		    	<input type="text" name="money" lay-verify="required|number" placeholder="请输入正整数" class="layui-input">
		    </div>
		</div>
		<div class="layui-form-item">
		    <label class="layui-form-label">支付密码</label>
		    <div class="layui-input-block">
		    	<input type="password" name="pwd" lay-verify="required" placeholder="请输入支付密码" class="layui-input">
		    </div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block" style="margin: 0;width: 90%; margin-left: 5%;">
				<input type="hidden" name="__token__" value="{$Request.token}" />
				<button class="layui-btn layui-btn-main login-btn" lay-submit style="width:100%;">确定</button>
			</div>
	  	</div>
	</form>
{/block}

{block name="script"}
	<script type="text/javascript">
		layui.use(['jquery','form','element'], function(){
	
		var $ = layui.jquery;
		var form = layui.form();
		var element = layui.element();
  
	  	//一些事件监听
	  	form.on('radio(account)', function(data){
	  		var html = '<label class="layui-form-label">收款人</label>\
	                <div class="layui-input-block">\
	                    <input type="text" name="account" placeholder="用户名或手机号" lay-verify="required" class="layui-input">\
	                </div>';
		  	if(data.value == 1){
		  		$("#account").append(html);
		  	}else{
		  		$("#account").html("");
		  	}
		});
	});
	</script>
{/block}